<?php
class Dao{
  static public $instance;//声明一个静态变量（保存在类中唯一的一个实例）
        static public function getinstance(){//声明一个getinstance()静态方法，用于检测是否有实例对象
        if(!self::$instance) self::$instance = new self();
          return self::$instance;
    }
    function link()
    {
      $servername = "localhost";
      $username = "root";
     $password = "wx25fbbc634ac5586b";
     $dbname = "card";
      $conn = new mysqli($servername, $username, $password, $dbname);
      return $conn;
    }
}
?>